package com.ruoyi.wechat.util;


/**
 * @Description: TODO(微信常量类)
 * @author cuihang
 * @date 2015-10-10 下午4:58:24
 */
public class ConstantWeChat {

	/**
	 * 获取小程序码无限制数量
	 */
	public final static String GET_WX_ACODE_UNLIMIT="https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=#ACCESS_TOKEN#";

	//获取token
	public final static String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=#APPID#&secret=#APPSECRET#";
	//获取jstoken
	public final static String JSAPI_TICKET = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=#ACCESS_TOKEN#&type=jsapi";
	// #公众号根据OAuth2.0获取openid
	public final static String GETCODEBYOAuth = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=WAPPID&secret=WSECRET&code=WCODE&grant_type=authorization_code";
	// #公众号根据code获得用户信息
	public final static String GETUSERBYCODE = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=#APPID#&secret=#SECRET#&code=#CODE#&grant_type=authorization_code";
	// 发送消息URL
	public final static String SENDMSGURL = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=#ACCESS_TOKEN#";

	// 用户管理
	//获得用户基本信息
	public final static String GETWECHATUSERINFO = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=#ACCESS_TOKEN#&openid=#OPENID#&lang=zh_CN";


	//支付统一下单
	public final static	String UNIFIEDORDER="https://api.mch.weixin.qq.com/pay/unifiedorder";

	//支付退款地址
	public final static	String REFUND="https://api.mch.weixin.qq.com/secapi/pay/refund";


	//消息模板获得模板ID
	public final static String GETTEMPLATEID="https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token=#ACCESS_TOKEN#";
	//发送消息模板
	public final static String SENDTEMPLAEMSG="https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=#ACCESS_TOKEN#";
	// 创建菜单
	public final static String CREATMENU = " https://api.weixin.qq.com/cgi-bin/menu/create?access_token=#ACCESS_TOKEN#";
	// 删除菜单
	public final static String DELMENU = " https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=#ACCESS_TOKEN#";
	public enum TEMPLATE_COLOR {
		/**
		 * 蓝色
		 */
		Blue("#000066",0),
		/**
		 * 蓝色1
		 */
		Blue1("#6495ED", 1),

		/**
		 * 红色2
		 */
		Red1("#EE30A7", 2);

		// 成员变量
		private String name;
		private int index;

		// 构造方法，注意：构造方法不能为public，因为enum并不可以被实例化
		private TEMPLATE_COLOR(String name, int index) {
			this.name = name;
			this.index = index;
		}

		// 普通方法
		public static String getName(int index) {

			for (TEMPLATE_COLOR c : TEMPLATE_COLOR.values()) {
				if (c.getIndex() == index) {
					return c.name;
				}
			}
			return null;
		}

		// get set 方法
		public String getName() {

			return name;
		}

		public void setName(String name) {

			this.name = name;
		}

		public int getIndex() {

			return index;
		}

		public void setIndex(int index) {

			this.index = index;
		}
	}
}
